<template>
  <!-- 注册 -->
  <div class>
    <div class="login-login">
      <el-form
        :model="ruleForm"
        status-icon
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >
        <el-form-item
          prop="email"
          class="iconfont icon-youxiang"
          :rules="[
                { required: true, message: '请输入邮箱地址', trigger: 'blur' },
                { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
                ]"
        >
          <el-input v-model="ruleForm.email"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button
            type="primary"
            @click="submitForm('ruleForm')"
            class="iconfont icon-iconfontjiantou"
          ></el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  name: "",
  data() {
    return {
      ruleForm: {
        email: ""
      }
    };
  },
  components: {},
  methods: {
    /* 提交事件 */
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
            /* 发送登陆请求 */
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    }
  }
};
</script>

<style lang="stylus" scoped>
.login-login {
  position: relative;
  width: 500px;
  margin: -60px auto 0;
  background: #fff;
  box-shadow: border-box;
  padding: 35px 55px 10px 0;
  border-radius: 5px;
}

.el-form-item__content > button {
  position: absolute;
  width: 50px;
  height: 50px;
  margin-top: -62px;
  right: -76px;
  padding: 0;
  border-radius: 50%;
  background-color: #ff9800;
  border: 1px solid #ff9800;
}

.el-checkbox {
  margin-left: 100px;
}

.el-form {
  position: relative;
}

.icon-youxiang:before {
  position: absolute;
  top: 8px;
  left: 72px;
}

.icon-iconfontjiantou:before {
  font-size: 20px;
}
</style>
